/* Copyright 2021 The TensorFlow Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
@use '@angular/material' as mat;
@import 'tensorboard/webapp/theme/tb_theme';

:host {
  display: inline-block;
}

.fob {
  display: inline-flex;
  background-color: mat.get-color-from-palette(mat.$gray-palette, 300);
  border-radius: 25px;
  padding: 2px 2px 2px 4px;
  font-size: 11px;
  text-align: center;
  width: min-content;

  > .prospective {
    padding-top: 1px;
  }

  &:hover {
    cursor: grab;

    &.prospective {
      cursor: pointer;
    }
  }
  &:active {
    cursor: grabbing;
  }

  &.unremovable {
    padding: 2px 4px;
  }

  &.prospective {
    align-items: center;
    box-sizing: border-box;
    border: 1px dashed mat.get-color-from-palette(mat.$gray-palette, 500);
    font-weight: bold;
    height: 17px;
  }
}

span {
  color: inherit;
  display: inline-block;

  @include tb-dark-theme {
    color: mat.get-color-from-palette(mat.$gray-palette, 700);
  }
}

button {
  margin-left: 2px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  font-size: 11px;
  width: 11px;
  height: 11px;
  background-color: inherit;
  color: inherit;
  .mat-icon {
    width: 100%;
    // The close icon is not a proportioned to fit nicely inside a circle.
    // Stretching the height to 110% helps it sit closer to the center of the
    // circular button.
    height: 110%;
  }

  @include tb-dark-theme {
    color: mat.get-color-from-palette(mat.$gray-palette, 700);
  }
}

button:hover {
  background-color: mat.get-color-from-palette(mat.$gray-palette, 500);
  color: mat.get-color-from-palette(mat.$gray-palette, 200);
  cursor: pointer;

  @include tb-dark-theme {
    background-color: mat.get-color-from-palette(mat.$gray-palette, 700);
    color: mat.get-color-from-palette(mat.$gray-palette, 300);
  }
}
